(function() {
    'use strict';
// Default colors
    var brandPrimary =  '#20a8d8';
    var brandSuccess =  '#4dbd74';
    var brandInfo =     '#63c2de';
    var brandWarning =  '#f8cb00';
    var brandDanger =   '#f86c6b';

    var grayDark =      '#2a2c36';
    var gray =          '#55595c';
    var grayLight =     '#818a91';
    var grayLighter =   '#d1d4d7';
    var grayLightest =  '#f8f9fa';
    angular
        .module('zhserverApp', [
            'ngStorage',
            'tmh.dynamicLocale',
            'pascalprecht.translate',
            'ngResource',
            'ngCookies',
            'ngAria',
            'ngCacheBuster',
            'ngFileUpload',
            'ui.bootstrap',
            'ui.bootstrap.datetimepicker',
            'ui.router',
            'infinite-scroll',
            'oc.lazyLoad',
            'ncy-angular-breadcrumb',
            // jhipster-needle-angularjs-add-module JHipster will add new module here
            'angular-loading-bar',
            'chart.js'
        ])
        .config(['cfpLoadingBarProvider','ChartJsProvider', function(cfpLoadingBarProvider,ChartJsProvider) {
            cfpLoadingBarProvider.includeSpinner = false;
            cfpLoadingBarProvider.latencyThreshold = 1;
            ChartJsProvider.setOptions({
                chartColors: ['#4d5360', '#97bbcd'],

            });

        }])
        .run(run);

    run.$inject = ['stateHandler', 'translationHandler','$rootScope', '$state', '$stateParams'];

    function run(stateHandler, translationHandler, $rootScope, $state, $stateParams) {
        stateHandler.initialize();
        translationHandler.initialize();
        $rootScope.$on('$stateChangeSuccess',function(){
            document.body.scrollTop = document.documentElement.scrollTop = 0;
        });
        $rootScope.$state = $state;
        return $rootScope.$stateParams = $stateParams;
    }
})();
